<?php

/**
 * Pub form.
 *
 * @package    theconnexter
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class PubForm extends BasePubForm
{
  public function configure()
  {
	unset($this['created_at'], $this['updated_at']);
	$this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array(
		  'label' => 'Image ',
		  'file_src'  => '/uploads/pubs/'.$this->getObject()->getImage(),
		  'is_image'  => true,
		  'edit_mode' => !$this->isNew(),
		  'template'  => '<div>%file%<br /><br /><br />%input%<br /><br /><div>%delete% %delete_label%</div></div>',
		));
    $this->validatorSchema['image_delete'] = new sfValidatorBoolean();

	$this->validatorSchema['image'] = new sfValidatorFile(array(
									  'required'   => false,
									  'path'       => sfConfig::get('sf_upload_dir').'/pubs',
									  'mime_types' => array('web_images','application/x-shockwave-flash')));

  }
}
